import Channel from '@/components/Channel';
import { useAppSelector } from '@/store';

import ArticleList from './components/ArticleList';
import styles from './index.module.scss';
export default function Home() {
  const { channel_id, userChannelList } = useAppSelector(
    (state) => state.channel
  );

  return (
    <div className={styles.root}>
      <Channel></Channel>

      {userChannelList.map((item) => {
        return (
          <div
            className="channel-list"
            key={item.id}
            style={{
              display:
                Number(channel_id) !== Number(item.id) ? 'none' : 'block',
            }}
          >
            <ArticleList channel_id={Number(item.id)} />
          </div>
        );
      })}
    </div>
  );
}
